// src/router/index.js
// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router'
import HomeworkPage from '../views/HomeworkPage.vue' 

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/homePage'  // 改为重定向到 homePage
    },
    {
      path: '/homePage',     // 添加不带 id 的路由
      name: 'HomeworkList',
      component: HomeworkPage
    },
    {
      path: '/homePage/:id',
      name: 'Homework',
      component: HomeworkPage
    }
  ]
})

export default router
